#ifndef STUINFOSYS
#define STUINFOSYS

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>

#define MAX_STUDENT_NUM 100
#define FILE_NAME "./studentInfo"
enum STUINFO
{
    SNO=1,
    SNAME=2,
    SSEX=3,
    SAGE=4,
    SDEPT=5
};

typedef struct sutdent_s
{
    char no[11];
    char name[20];
    char sex[4];
    char age[3];
    char dept[20];
} student_t;

typedef struct studentInfoSystem_s
{
    student_t stu_arr[MAX_STUDENT_NUM];
    int stu_num;
} stuInfoSystem;

static stuInfoSystem stuSys={0};

int addStudentInfo();
int delStudentInfo();
int updateStudentInfo();
void PrintfStuFromNo();
void printfAllStu();
student_t inputAddInfo();
char *inputSno();

int writeToFile();
int readFromFile();
#endif